error.spec.js ➔ ???   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 6
Bugs 0 Features 0
Metric Value
cc 1
c 6
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
import test from 'ava';
2
import UnityCacheError from '../src/error';
3
4
test.beforeEach(t => {
5
    t.context.error = new UnityCacheError('Something something');
6
});
7
8
test('instance of Error', t => {
9
    t.true(t.context.error instanceof Error)
10
});
11
12
test('instance of UnityCacheError', t => {
13
    t.true(t.context.error instanceof UnityCacheError)
14
});
15
16
test('to string', t => {
17
    t.is(t.context.error.toString(), 'UnityCacheError: Something something')
18
});
19
20
test('empty message', t => {
21
    t.is((new UnityCacheError()).toString(), 'UnityCacheError')
22
});